<template>
  <div class="userInfo">
    <div class="userInfo-box">
      <NuxtImg src="/images/user/headsculpture_img_0.png" />
      <div class="user_info_box">
        <div class="user_m">
          <p>
            {{ lang.user_name }}
            <span class="recharge_box"
              ><NuxtImg src="/images/user/vipSignIn_0.png" class="vipImg"
            /></span>
          </p>
          <div class="b_box"></div>
          <div class="b_box">
            <div>ID:{{ userId }}</div>
            <NuxtImg
              src="/images/layout/icon-copy.png"
              v-click-move
              @click="copyText(userId)"
            />
          </div>
        </div>
        <div class="money_box">
          <p class="text">{{ lang.tip }}</p>
          <p class="money">
            {{ userStore.moneyUnit }} <span>{{ userMoney }}</span>
          </p>
        </div>
      </div>
    </div>
    <div class="btn-box">
      <div class="btn btn1" v-click-move @click="toCarteira(1)">
        <span>{{ lang.deposit_btn }}</span>
      </div>
      <div class="btn btn2" v-click-move @click="toCarteira(2)">
        <span>{{ lang.withdraw_btn }}</span>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
const lang: any = getCurrentPageLang("user");

const userStore = useUserStore();

const userId = ref("4031730");
const userMoney = ref("3.50");

function toCarteira(type: number) {
  userStore.changeShowUser(false);
  userStore.changeShowCarteira(true, type);
}
</script>

<style scoped lang="scss">
.userInfo {
  width: 100%;
  display: flex;
  flex-direction: column;

  .userInfo-box {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
    gap: 0.2rem;
  }

  img {
    width: 2rem;
  }

  .user_info_box {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .user_m {
    display: flex;
    flex-direction: column;
    gap: 0.11rem;
    margin-left: 0.1rem;
    font-size: 0.4rem;
    color: var(--theme-neutral1);

    p {
      font-size: var(--font-title2);
      margin-bottom: 0.2rem;
      display: flex;
      align-items: center;
      font-weight: 100;
    }

    .b_box {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: var(--font-title2);
      gap: 0.1rem;
      position: relative;
      z-index: 1;

      div {
        font-weight: 100;
      }

      img {
        width: 0.5rem;
        height: 0.5rem;
        margin-left: 0.1rem;
      }
    }
  }

  .recharge_box {
    display: flex;
    align-items: center;
    position: relative;
    margin-left: 0.1rem;

    img {
      width: 1.2rem;
      object-fit: contain;
      position: absolute;
    }
  }

  .money_box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-right: 0.4rem;

    .text {
      margin-bottom: 0.3rem;
      color: #fff;
      font-size: 0.3rem;
    }

    .money {
      height: 0.75rem;
      background: #221b24;
      border: 0.03rem solid var(--border-color);
      border-radius: 0.8rem;
      color: #ffd700;
      display: flex;
      align-items: center;
      padding: 0 0.3rem;

      span {
        color: #fff;
        font-size: var(--font-title2);
        margin-left: 0.15rem;
      }
    }
  }

  .btn-box {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.3rem;

    .btn {
      height: 1.2rem;
      font-size: 0.46rem;
      color: var(--theme-neutral1);
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 0.3rem;
      position: relative;
      cursor: pointer;

      span {
        position: relative;
        z-index: 2;
      }

      &.btn1 {
        background: #fd66b1;
      }

      &.btn2 {
        background: #40294f;
        color: #7c5a86;
      }
    }
  }
}
</style>
